//
//  ProdIterator.m
//  DesignModel
//
//  Created by 赵明明 on 2022/1/5.
//

#import "ProdIterator.h"

@implementation ProdIterator
-(ProdIterator *)myinit:(NSMutableArray*) item{
    _Item=item;
    _current=0;
    return self;
}
-(id)First{
    return [_Item firstObject];
}
-(id)Current{
    return [_Item objectAtIndex:_current];
}
-(id)Next{
    _current++;
    if(![self isDone]){
        return [_Item objectAtIndex:_current];
    }
    else{
        return nil;
    }
}
-(BOOL)isDone{
    return _current>=_Item.count;
}
@end
